#count the gap in the fasta
#需要比对之后的 fasta 文件
from Bio import SeqIO

#创建一个列表
ori_li = [str(seq_record.seq) for seq_record in SeqIO.parse("spikeprot1120.fasta", "fasta")]

#先测试下原始序列中是否有这两条
for i in range(len(li)):
  if li[i].count('QTQTN',0,len(li[i])) == 1:
    print(i)
for i in range(len(li)):
  if li[i].count('NSPRRAR',0,len(li[i])) == 1:
    print(i)

#创建一个列表比对之后的
align_li=[str(seq_record.seq) for seq_record in SeqIO.parse("spikeprot1120.out", "fasta")]
#确定位置需要手动，然后根据位置来进行判断
count_5=0
for i in range(len(align_li)):
  if align_li[i][3219:3317].replace('-','') == 'QTQTN':
    count_5=count_5+1
count_5 = 205093
#2746

count_7=0
for i in range(len(align_li)):
  if align_li[i][3316:3485].replace('-','') == 'NSPRRAR':
    count_7=count_7+1
count_7 = 205478
#2361
#5:QTQTN
#7:NSPRRAR
